/**
 * @version v1.0
 * @Description:
 * @Author zhanzhongxin
 * @Date 2021/7/8 10:21
 * @Copyright 博为峰
 */
public class ArrayDemo02 {
    public static void main(String[] args) {
        /*
           数据类型[] 数组名 = new 数据类型[]{元素1,元素2,...}
           数据类型[] 数组名 = {元素1,元素2,...};
         */

        int[] arr = new int[]{1, 2, 3};
        arr[0] = 6;
        System.out.println("arr = " + arr);

        int[] arr2 = new int[]{4, 5, 6};
        System.out.println("arr2 = " + arr2);

//        for (int i : arr) {
//            System.out.println("i = " + i);
//        }

        arr = arr2;

        arr = null;

//        System.out.println(arr[0]);//NullPointerException 空指针异常

        String[] s = {"张三", "李四", "王五"};
    }
}
